package 
{
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Common.b2internal;
	import Box2D.Dynamics.Joints.b2JointDef;
	import Box2D.Dynamics.Joints.b2RevoluteJoint;
	import Box2D.Dynamics.Joints.b2RevoluteJointDef;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.utils.getTimer;
	
	import phi.engine.PhiEngine;
	import phi.engine.actors.GroundActor;
	import phi.engine.actors.IActor;
	import phi.engine.actors.PolygonActor;
	import phi.engine.actors.SensorActor;
	import phi.engine.layers.ILayer;
	import phi.engine.layers.Layer;
	import phi.engine.layers.ScrollActorLayer2;
	import phi.engine.utils.PhiMathUtil;
	import phi.game.ball.actors.BallActor;
	import phi.game.ball.core.ContactListner;
	
	/**
	 * ...
	 * @author Alexandru Ghiura
	 */
	[SWF( width='1000', height='630', backgroundColor='#FFFFFF', frameRate='60' )]
	public class BallGame extends Sprite 
	{
		protected var engine :PhiEngine;
		protected var firstKeyDown :Boolean = true;
		protected var firstKeyDownTime :Number = 0;
		
		protected var score :Number = 0;
		
		public function BallGame():void 
		{
			// Init engine
			engine = PhiEngine.getInstance();
			//engine.setup( new RunGame( this ), stage );
			engine.setup( new RunGame( this ), stage );
			engine.game.world.SetContactListener( new ContactListner() );
			//engine.debugDraw = true;
			
			engine.run();
		}
	}
	
}